package org.apache.lucene.index;

public class TagBlockKey {
  private int blockNum;
  private Term term;
  
  public TagBlockKey(int blockNum, Term term) {
    this.blockNum = blockNum;
    this.term = term;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + blockNum;
    result = prime * result + ((term == null) ? 0 : term.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    final TagBlockKey other = (TagBlockKey) obj;
    if (blockNum != other.blockNum)
      return false;
    if (term == null) {
      if (other.term != null)
        return false;
    } else if (!term.equals(other.term))
      return false;
    return true;
  }
  
  
}
